﻿<Window x:Class="Inverse.XPath.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Inverse.XPath"
        Title="{x:Static local:MessageStrings.ApplicationTitle}"
        MinHeight="400"
        MinWidth="500"
        WindowState="Maximized"
        Loaded="WindowLoaded"
        Unloaded="WindowUnloaded">

    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            
            <TextBox x:Name="expressionTextBox" />
            <TextBlock x:Name="countTextBlock" Text="{x:Static local:MessageStrings.NoMatchesFoundText}" Margin="10,0,0,0" FontWeight="Bold" Grid.Column="1" />
        </Grid>
        
        <Border Grid.Row="1" Margin="0,10,0,0" BorderBrush="Black" BorderThickness="1">
            <FlowDocumentScrollViewer Name="docReader" FocusVisualStyle="{x:Null}">
                <FlowDocumentScrollViewer.Resources>
                    <Style TargetType="{x:Type Paragraph}">
                        <Setter Property="Margin" Value="0" />
                        <Setter Property="FontFamily" Value="Consolas" />
                        <Setter Property="FontSize" Value="12" />
                    </Style>
                </FlowDocumentScrollViewer.Resources>
            </FlowDocumentScrollViewer>
        </Border>

        <Grid Grid.Row="2" Margin="0,10,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal">
                <Button Width="120" Content="{x:Static local:MessageStrings.OpenButtonText}" Click="OpenButtonClick" FocusVisualStyle="{x:Null}" />
                <Button Width="120" Content="{x:Static local:MessageStrings.ClipboardButtonText}" Click="ClipboardButtonClick" FocusVisualStyle="{x:Null}" Margin="10,0,0,0" />
                <Button Width="120" Content="{x:Static local:MessageStrings.MatchButtonText}" Click="MatchButtonClick" FocusVisualStyle="{x:Null}" Margin="10,0,0,0" />
            </StackPanel>
            <ToggleButton x:Name="wordWrapToggleButton"
                          Grid.Column="1"
                          Width="120"
                          IsChecked="True"
                          Content="{x:Static local:MessageStrings.WordWrapButtonText}"
                          Checked="WordWrapCheckBoxChecked"
                          Unchecked="WordWrapCheckBoxChecked" />
        </Grid>
    </Grid>
</Window>